<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="tabmode" value="${empty cookie.tabmode.value ? '1' : cookie.tabmode.value}"/>
<html>
<head>
    <title>我导入的</title>
    <meta name="decorator" content="default"/>
    <link rel="stylesheet" href="${ctxStatic}/bootstrap-table/bootstrap-table.css">
    <style type="text/css">
    	.modal-header {padding: 8px 15px 8px 15px;}
    	.modal-footer {padding: 5px 15px 5px 15px;}
        .modal-body {padding: 0px 15px 0px 15px;}
        .open-close {height: 15px; width: 100%; text-align: center;cursor: pointer;}
        .breadcrumb {margin-bottom: 0px;}
    </style>
</head>
<body>
<ul class="nav nav-tabs">
    <li ><a href="${ctx}/mywork/potentialCustomer/distlist">分配给我的</a></li>
    <li class="active"><a href="${ctx}/mywork/potentialCustomer/mylist">我导入的</a></li>
</ul>
<form id="searchForm" action="${ctx}/mywork/potentialCustomer/listMyData" method="post"
      class="breadcrumb form-search">
    <input  name="recordVisibilityRule" value="private" type="hidden">
    <input  name="visibilityUserId" value="${fns:getUser().id}" type="hidden">
    <ul class="ul-form">
        <li><label>意向产品：</label>
            <sys:productType id="targetProducts" name="targetProducts" withWu="true"
                             withAll="true" cssClass="select-medium"></sys:productType>
        </li>
        <li><label>客户状态：</label>
            <sys:customerStatus id="customerStatusId" name="customerStatusId"
                                withAll="true" cssClass="select-medium"/>
        </li>
        <li><label>分组：</label>
            <sys:treeselect id="realGroupId" name="realGroupId" value="${potentialGroup.parent.id}"
                            labelName="realGroupName" labelValue="${potentialGroup.parent.name}"
                            title="分组" url="/mywork/potentialCustomer/potentialGroup/treeData?addDefault=true"
                            extId="${potentialGroup.id}"
                            cssClass="input-small" allowClear="true"/>
        </li>
        <li><label>是否联系：</label>
            <select name="visitNum" class="select-medium">
                <option value="">全部</option>
                <option value="1">是</option>
                <option value="0">否</option>
            </select>
        </li>
        <li><label>公司名称：</label>
            <input name="corporationName" type="text" class="input-medium"/>
        </li>
        <li><label>手机号：</label>
            <input name="mobile" type="text" class="input-medium"/>
        </li>
        <li><label>联系人：</label>
            <input name="contactorName" type="text" class="input-medium"/>
        </li>
        <li><label>固定电话：</label>
            <input name="telephone" type="text" class="input-medium"/>
        </li>
        <li><label>省份：</label>
            <sys:region id="provinceId" name="provinceId" withAll="true"
                        cssClass="select-medium"></sys:region>
        </li>
        <li><label>一级来源：</label>
            <input name="source" type="text" class="input-medium"/>
        </li>
        <li><label>二级级来源：</label>
            <input name="sourceDesc" type="text" class="input-medium"/>
        </li>
        <li><label>来源设备：</label>
            <select name="mobileOrPc" class="select-medium">
                <option value="">全部</option>
                <c:forEach items="${fns:getDictList('POTENTIAL_SOURCE')}" var="ps">
                    <option value="${ps.value }">${ps}</option>
                </c:forEach>
            </select>
        </li>
        <li class="btns">
            <button type="button" id="btnSearch" onclick="refreshTableData();" class="btn btn-primary">查询 &nbsp;<i
                    class="icon-search icon-white"></i></button>
        </li>
        <li class="clearfix"></li>
    </ul>
</form>
<div class="open-close"><i class="fa-chevron-up"></i></div>
<table id="contentTable" data-url="${ctx}/mywork/potentialCustomer/listMyData">
    <thead>
    <tr>
        <th colspan="12">
            <ul class="nav nav-toolbar">
                <li class="show-ctrl">
                    <a id="aGroup" data-url="${ctx}/mywork/potentialCustomer/potentialGroup/index" href="javascript:void(0);">分组</a>
                </li>
            </ul>
        </th>
    </tr>
    <tr>
        <th data-field="state" data-checkbox="true" data-align="center"></th>
        <th data-field="dataStatus" data-align="left" data-formatter="dataStatusFormatter">重复数据（新）</th>
        <th data-field="lastUpdated" data-align="left">更新时间</th>
        <th data-field="corporationName" data-align="left" data-formatter="corporationNameFormatter">公司名称</th>
        <th data-field="targetProducts" data-align="left" data-formatter="targetProductsFormatter">目标产品</th>
        <th data-field="customerStatus" data-align="left">客户状态</th>
        <th data-field="lastCustomerStatus" data-align="left">上次客户状态</th>
        <th data-field="dateVisit" data-align="left">最后跟进时间</th>
        <th data-field="visitRecord" data-align="left">最后跟进记录</th>
        <th data-field="dateAppointment" data-align="left">预约回访时间</th>
        <th data-field="isContact" data-align="left" data-formatter="visitNumFormatter">是否联系</th>
    </tr>
    </thead>
</table>

<div id="groupModal" class="modal hide fade" style="width: 750px;margin-left:-350px;max-height: 400px;" tabindex="-1"
     role="dialog" aria-labelledby="groupModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h5 id="groupModalLabel">数据分组</h5>
    </div>
    <div class="modal-body">
        <iframe id="groupPage" name="groupPage" style="width: 100%;border: none;height: 300px;"></iframe>
    </div>
    <div class="modal-footer">
        <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
        <button id="btnGroup" data-url="${ctx}/mywork/potentialCustomer/group" class="btn btn-primary">确定
        </button>
    </div>
</div>
<script src="${ctxStatic}/bootstrap-table/bootstrap-table.js"></script>
<script src="${ctxStatic}/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
<script src="${ctxStatic}/bootstrap-table/config.js"></script>
<script src="${ctxStatic}/modules/mywork/potentialCustomerList.js" type="application/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {

        $(".addTab").live("click", function () {
            var href = $(this).attr("data-href");

            // <c:if test="${tabmode eq '1'}"> 打开显示页签
            return window.parent.addTab($(this)); // </c:if>
        });
    });
</script>
</body>
</html>